<template>
  <div class="gender-container">
    <van-picker show-toolbar :columns="columns" @cancel="$emit('genderfunc')" @confirm="onConfirm"/>
  </div>
</template>
           
<script>
import { profile_api } from '@/api/profile.js'
export default {
  data() {
    return {
      columns: ['男', '女']
    }
  },
  methods: {
    async onConfirm(value, index) {
      //console.log(value,index, 8888)

      const { data: res } = await profile_api({
        gender: index
      })
      this.$emit('genderfunc', res.data.gender)
      console.log(res, 77788)
    }
  }
}
</script>
<style scoped>
</style>